home *** CD-ROM | disk | FTP | other *** search
- ##############################################################################
- # Basic Random Image Displayer Version 1.2 #
- # Copyright 1996 Matt Wright mattw@worldwidemart.com #
- # Created 7/1/95 Last Modified 7/20/95 #
- # Scripts Archive at: http://www.worldwidemart.com/scripts/ #
- ##############################################################################
- # If you run into any problems while trying to configure this scripts, help #
- # is available. The steps you should take to get the fastest results, are: #
- # 1) Read this file thoroughly #
- # 2) Consult the Matt's Script Archive Frequently Asked Questions: #
- # http://www.worldwidemart.com/scripts/faq/ #
- # 3) If you are still having difficulty installing this script, send #
- # e-mail to: scripts-help@tahoenet.com #
- # Include any error messages you are receiving and as much detail #
- # as you can so we can spot your problem. Also include the variable#
- # configuration block that is located at the top of the script. #
- # #
- # Hopefully we will be able to help you solve your problems. Thank you. #
- ##############################################################################
- # COPYRIGHT NOTICE #
- # Copyright 1996 Matthew M. Wright All Rights Reserved. #
- # #
- # Basic Random Image may be used and modified free of charge by anyone so #
- # long as this copyright notice and the comments above remain intact. By #
- # using this this code you agree to indemnify Matthew M. Wright from any #
- # liability that might arise from it's use. #
- # #
- # Selling the code for this program without prior written consent is #
- # expressly forbidden. In other words, please ask first before you try and #
- # make money off of my program. #
- # #
- # Obtain permission before redistributing this software over the Internet or #
- # in any other medium. In all cases copyright and header must remain intact.#
- ##############################################################################
-
- The Random Image Displayer will allow you to call on different images each
- time your page is reloaded and accessed. The Random Image Displayer consists
- of two files, the rand_image.pl and README.
-
- rand_image.pl - The perl script that calls on the random image.
- README - This file (Installation instructions)
-
- This is one of my more simple scripts, yet still very useful for its purpose.
- Below is a description of how to configure the files:
-
- RAND_IMAGE.PL -
- This is the main file and the one that is called upon every time your
- page is loaded. You will need to place this file in your server's cgi-bin and
- give users the permission to read/execute this file. (chmod 755 or chmod a+rx)
- There are also several variables you will have to define:
-
- # Define Necessary Variables
- $basedir = "";
- This is the http address and base directory that your pictures
- are placed in. This is in url form. The filenames you
- specify will be appended to this address. Examples Below.
- @files = ("","");
- These are all of your files placed into array. The filenames
- should be reflective of the location of the files relative
- to your $basedir. Examples Below.
-
- # Choose Options
- $uselog = 1; # 1 = YES; 0 = NO
- You can enable the usage of a short log, which will simply log
- the name of each file as it is accessed. Not very fancy, but
- it can be useful.
- $logfile = "";
- The system path to your log file and where you want it kept.
- Keep in mind that this log file must be placed in a world
- writable directory. If you don't create a log file, but
- point the path to a world writeable directory and give it a
- false filename, the script will create the file for you. This
- is not a required variable if you turn off $uselog.
- ________________________________________________________________
-
- README -
- All you have to do with this file is read it! :)
- ________________________________________________________________
-
- Example:
- Let's say I have 5 files. They are all in a root directory called:
- /home/mattw/public_html/, but from there they branch out to:
- pics/funny.gif, nature/waterfalls.gif, pics/cool.gif, nature/tree.gif, and
- pics/www.gif. Where pics/ and nature/ are directories that these images are
- located in. Your variables should show as follows:
-
- $basedir = "http://alpha.pr1.k12.co.us/~mattw/";
- @files = ("pics/funny.gif","nature/waterfalls.gif","pics/cool.gif",
- "nature/tree.gif","pics/www.gif");
-
- It's that easy!
- ________________________________________________________________
-
- How do I implement this in my pages?
- This file can be used in your pages in one of the following syntaxes.
- It can do backgrounds, or just plain image references. To activate it do the
- following:
- <img src="http://www.ser.ver/cgi-bin/rand_image.pl">
- This is when you want it to call a random image.
- <body background="http://www.ser.ver/cgi-bin/rand_image.pl">
- This is when you want it to call a random background.
-
- Things to be careful of:
- If you are using it as a random background program, you will want to
- make sure that all of your backgrounds will work with the specified colors.
- In other words, if you have a dark and a light image in your random image path
- it will be hard to find a text color to work in both instances.
- ________________________________________________________________
- HISTORY:
- Version 1.0 7/1 - First Created
- Version 1.1 7/17 - Completely Re-written. Less variables to fill
- in, added flexibility: including pics in
- different directories and pics with names
- unlike others. A big improvement over the last
- version. You can also have different
- extensions like .jpg and .gif.
- Version 1.2 7/20 - Eliminated the $numfiles variable and can now
- take the random number straight fom the array.
- ________________________________________________________________
-
- Use this script freely and enjoy! All that I ask is that you register your
- script with me either by mailing me the url of where I can find it or filling
- out the form located at:
- http://worldwidemart.com/scripts/implement.html
-
- This registration is free but it allows me to add you to a list showing other
- examples of my scripts, as well as it allows me to inform you of any upgrades
- I ever release. Thanks.
-
- I also ask that you keep my name somewhere in the scripts. Not necessarily in
- a spot viewable to your users (although it would be nice) but somewhere behind
- the scenes as a point of reference.
-
- If you modify this script, please let me know just so I can improve it for
- other users as well. Enjoy!
- _____________________________________________________________________________
- Matt Wright - mattw@worldwidemart.com - http://www.worldwidemart.com/scripts/
-